﻿using System;
using System.Web;
using System.Web.Security;

public partial class ProductAging_ManuAging_ManuIndex : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Check();
    }

    protected void Check()
    {
        if (HttpContext.Current != null)
        {
            if (Roles.IsUserInRole("Aginger"))
            {
                this.P1.Visible = true;
                this.P8.Visible = true;
                this.P9.Visible = true;
                this.P10.Visible = true;
                this.P11.Visible = true;
                this.P12.Visible = true;
                this.P2.Visible = true;
                this.P4.Visible = true;
                //this.P5.Visible = true;
                //this.P6.Visible = true;
                //this.P7.Visible = true;
            }
            if (Roles.IsUserInRole("Packer"))
            {
                this.P3.Visible = true;
            }
            //if (Roles.IsUserInRole("Quality Engineer"))
            //{
            //    this.P1.Visible = true;
            //}
            if (Roles.IsUserInRole("Manager"))
            {
                this.P1.Visible = true;
                this.P2.Visible = true;
                this.P3.Visible = true;
                this.P4.Visible = true;
                this.P5.Visible = true;
                this.P6.Visible = true;
                this.P7.Visible = true;
                this.P8.Visible = true;
                this.P9.Visible = true;
                this.P10.Visible = true;
                this.P11.Visible = true;
                this.P12.Visible = true;
            }
            if (Roles.IsUserInRole("Administrators"))
            {
                this.P1.Visible = true;
                this.P2.Visible = true;
                this.P3.Visible = true;
                this.P4.Visible = true;
                this.P5.Visible = true;
                this.P6.Visible = true;
                this.P7.Visible = true;
                this.P8.Visible = true;
                this.P9.Visible = true;
                this.P10.Visible = true;
                this.P11.Visible = true;
                this.P12.Visible = true;
            }
        }
    }
}
